using System;
using System.Reflection.Emit;
using Pine.Core;
using Pine.SourceParser.Tree;

namespace Pine.CodeGen
{
	public static class StringConstantCodeGenerator
	{
		public static void GenerateBytecode(Context ctx, Expression expr, LocalBuilder lb) {
			ctx.il.Emit(OpCodes.Ldstr, ((StringConstant) expr).Value);
			ctx.il.Emit(OpCodes.Newobj, typeof(StringValue).GetConstructor(new Type[] { typeof(string) }));
			ctx.il.Emit(OpCodes.Stloc, lb);
		}
	}
}

